/** @type {import('stylelint').Config} */
import order from 'stylelint-order';

export default {
	plugins: [order],
	extends: ['stylelint-config-standard', 'stylelint-config-standard-scss'],
	rules: {
		'unit-no-unknown': [true, { ignoreUnits: 'rpx' }],
		'selector-type-no-unknown': [true, { ignoreTypes: ['page', 'picker', '/^uni-/', 'radio', 'radio-group'] }],
		'no-descending-specificity': null,
		'color-function-notation': 'legacy',
		'alpha-value-notation': 'number',
		'order/order': [
			'custom-properties',
			'dollar-variables',
			'at-variables',
			'declarations',
			'less-mixins',
			{ type: 'rule', selector: '/^&-.*$/' },
			{ type: 'rule', selector: '/^&:.*$/' },
			{ type: 'rule', selector: '/^&\\..*$/' },
			'rules',
		],
		'order/properties-order': [
			'width',
			'height',
			'box-sizing',
			'overflow',
			'position',
			'top',
			'right',
			'bottom',
			'left',
			'margin',
			'margin-top',
			'margin-right',
			'margin-bottom',
			'margin-left',
			'inset',
			'display',
			'grid-template-columns',
			'float',
			'justify-content',
			'align-items',
			'padding',
			'padding-top',
			'padding-right',
			'padding-bottom',
			'padding-left',
			'background',
			'background-color',
			'background-image',
			'color',
			'font',
			'font-size',
			'font-weight',
			'text-align',
			'border',
			'box-shadow',
			'visibility',
			'opacity',
			'transition',
			'z-index',
		],
	},
	ignoreFiles: ['components/**/*', 'uni_modules/**/*', 'uni.scss', 'node_modules/**/*', 'unpackage/**/*'],
};
